<?php

$userid = get_loggedin_userid();

$friendid = get_input('friend_id');
$client_id = get_input('client_id');

if($client_id == OPINIONS) {
    cancel_opinions_friend($friendid, $userid);
    $result = check_opinions_friend($userid, $friendid);
} else {
    cancel_whiteboard_friend($friendid, $userid);
    $result = check_whiteboard_friend($userid, $friendid);
}

echo json_encode(export_result(200, $result));

?>
